# -*- coding: utf-8 -*-

import threading

# thread local object
thread_local = threading.local()

def get_msg_id():
    ''' get message id of current thread '''
    if not hasattr(thread_local, "msg_id"):
        msg_id = ""
        thread_local.msg_id = msg_id
    else:
        msg_id = thread_local.msg_id

    return msg_id

def clean_msg_id():
    ''' clean message id of current thread '''
    thread_local.msg_id = ""

def set_msg_id(msg_id):
    ''' set message id of current thread '''
    thread_local.msg_id = msg_id

